home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sources / xbmbrows / xbmbro31.z / xbmbro31 / xbmbrowser3.1 / xbmbrowser.h < prev    next >
C/C++ Source or Header  |  1993-08-05  |  5KB  |  141 lines

  1. /*
  2. *****************************************************************************
  3. ** xbmbrowser version 3.1  (c) Copyright Ashley Roll, 1992.
  4. ** FILE: xbmbrowser.h 
  5. **
  6. ** xbmbrowser is Public Domain. However it, and all the code still belong to me.
  7. ** I do, however grant permission for you to freely copy and distribute it on 
  8. ** the condition that this and all other copyright notices remain unchanged in 
  9. ** all distributions.
  10. **
  11. ** This software comes with NO warranty whatsoever. I therefore take no
  12. ** responsibility for any damages, losses or problems that the program may 
  13. ** cause.
  14. *****************************************************************************
  15. */
  16.  
  17. #include <stdio.h>             /* C library includes */
  18. #include <X11/Xos.h> /* include some system .h files independant of OS */ 
  19. #include <dirent.h> 
  20. #include <sys/stat.h>
  21. #include <assert.h>   /* for assertions in bitmap.c */
  22.  
  23. #include <X11/Xlib.h>          /* X programming includes */
  24. #include <X11/Xutil.h>
  25. #include <X11/Xatom.h>
  26. #include <X11/cursorfont.h>
  27. #include <X11/Intrinsic.h>      
  28. #include <X11/StringDefs.h>
  29.  
  30. #include <X11/Xaw/Form.h>      /* widget includes */
  31. #include <X11/Xaw/Box.h>
  32. #include <X11/Xaw/Dialog.h> 
  33. #include <X11/Xaw/MenuButton.h>
  34. #include <X11/Xaw/SimpleMenu.h>
  35. #include <X11/Xaw/SmeBSB.h>
  36. #include <X11/Xaw/SmeLine.h>
  37. #include <X11/Xaw/AsciiText.h>
  38. #include <X11/Xaw/List.h>
  39. #include <X11/Xaw/Paned.h>
  40. #include <X11/Xaw/Viewport.h>
  41.  
  42. #ifdef DO_XPMS
  43. # include <X11/xpm.h>
  44. #endif
  45.  
  46.  
  47. /***************************************************************************
  48.     SITE SPECIFIC STUFF - EDIT TO MATCH YOUR SETUP
  49.  ***************************************************************************/
  50. /*
  51. ** The full path to the Help file.
  52. */
  53. #ifndef HELPFILE
  54. #define HELPFILE "/usr/lib/X11/xbmbrowser.help"
  55. #endif
  56.  
  57. /*
  58. ** The full path to the default menu definition file
  59. */
  60. #ifndef DEFAULT_RC_FILE
  61. #define DEFAULT_RC_FILE "/usr/lib/X11/xbmbrowser.menu"
  62. #endif
  63.  
  64. /*
  65. ** The name of the menu definition file to look for in the users home directory
  66. */
  67. #ifndef HOME_DIR_FILE
  68. #define HOME_DIR_FILE ".xbmbrowserrc"
  69. #endif
  70.  
  71.  
  72. /***************************************************************************
  73.     PROGRAM STUFF - CHANGE IT AT YOUR OWN RISK
  74.  ***************************************************************************/
  75.  
  76. enum FileType {    /* the various types of file we deal with */
  77.   Bad, Dir, File, Xbm, Xpm, BadXpm,
  78.   NumFileTypes     /* this is not a file type, just a count of file types */
  79. };
  80.  
  81. typedef struct _item {
  82.   char              fname[255];  /* filename in directory - widgets label */
  83.   char              info[80];    /* information line to display */
  84.   time_t            mtime;       /* last modification time */
  85.   enum FileType     type;        /* file type */
  86.   Pixmap            bitmap;      /* bitmap from this file - to widget */
  87.   int               index;       /* widget the bitmap is currently in */
  88. #ifdef DO_XPMS
  89.   XpmAttributes     attr;        /* xpm attributes -- colors to free */
  90. #endif
  91.   struct _item     *next;        /* next item */
  92. } Item;
  93.  
  94.  
  95. #ifdef MAIN
  96. #define ext
  97. #else
  98. #define ext extern
  99. #endif
  100.  
  101. ext char       dname[256];           /* current directory path */
  102. ext char       label_info[256];      /* label to show when outside bitmap */
  103. ext char      *bitmap_info;          /* information of the current widget */
  104. ext Cursor     normalCursor, waitCursor;                      /* Cursours */
  105. ext Widget     toplevel, mainpw, bfw, bw, lw, phw, atw, menu; /* Widgets */
  106. ext Widget     dirPopup,dirList;    /* directory popup widgets */
  107. ext int        ac;                  /* argc copy */
  108. ext char     **av;                  /* argv copy */
  109. ext int        dialogs_made;        /* has the dialog widgets been made */
  110. ext Pixmap     stipple;             /* the stipple bitmap pattern */
  111.  
  112. /* external callback procedures */
  113. extern void    DoQuit();
  114. extern void    Ok();
  115. extern Widget  MakeMenu();
  116. extern Widget  AddMenuItem();
  117. extern void    Show_Help();
  118. extern void    Inform_User();
  119. extern void    SetWindowIcon();
  120. extern void    set_name();
  121. extern void    set_label();
  122. extern void    rescan();
  123. extern void    destroy_Callback();
  124. extern void    change_dir();
  125. extern void    dir_menu();
  126.  
  127. /* miscelanous functions */
  128. extern void    setup_dialog();
  129. extern void    pos_dir();
  130. extern Item   *get_files();
  131.  
  132. /* external routines from bitmap.c module */
  133. extern Item   *alloc_item();
  134. extern Item   *free_item();
  135. extern void    free_list();
  136. extern void    scan_bitmaps();
  137. extern void    rescan_bitmaps();
  138.  
  139. /* some external variables */
  140. extern char Translations[];
  141.